﻿/// <reference path="vswd-ext_2.2.js" />

/******************************************
 *Create Date : 2009 -12-10
 *Description : this file create main menu in main window
 ********************************************/
/*******************************************
 *地图操作
 *******************************************/

var menufullmap = new Ext.menu.Item({
		id : 'menufullmap',
		icon : 'Content/images/clock.png',
		text : _TrackerMain_FullMapMode,
		handler : handlerMenu
	});

var menustreetview = new Ext.menu.Item({
		id : 'menustreetview',
		icon : 'Content/images/view.gif',
		text : _TrackerMain_StreetViewMode,
		handler : handlerMenu
	});

var menumapcontrol = new Ext.menu.Menu({
		id : 'menumapcontrol',
		icon : 'Content/images/application_home.png',
		items : [menustreetview]
	});

/******************************************/

/*******************************************
 *语言类型
 *******************************************/
var menulangenglish = new Ext.menu.CheckItem({
		text : _TrackerMain_English,
		group : 'langcheckgroup',
		handler : handlerMenu
	});

var menulangchinese = new Ext.menu.CheckItem({
		text : _TrackerMain_Chinese,
		group : 'langcheckgroup',
		handler : handlerMenu
	});

var menulangspanish = new Ext.menu.CheckItem({
		text : _TrackerMain_Spanish,
		group : 'langcheckgroup',
		handler : handlerMenu
	});

var menude = new Ext.menu.CheckItem({
		text : 'Deutsch',
		group : 'langcheckgroup',
		handler : handlerMenu
	});

var menuVietnamese = new Ext.menu.CheckItem({
		text : _TrackerMain_Vietnamese,
		group : 'langcheckgroup',
		handler : handlerMenu
	});

var menuAb = new Ext.menu.CheckItem({
		text : _TrackerMain_Arabic,
		group : 'langcheckgroup',
		handler : handlerMenu
	});

var menuRu = new Ext.menu.CheckItem({
		text : _TrackerMain_Russian,
		group : 'langcheckgroup',
		handler : handlerMenu
	});

var menuPor = new Ext.menu.CheckItem({
		text : _TrackerMain_Portuguese,
		group : 'langcheckgroup',
		handler : handlerMenu
	});

var menuDa = new Ext.menu.CheckItem({
		text : _TrackerMain_Dansk,
		group : 'langcheckgroup',
		handler : handlerMenu
	});

var menuFrench = new Ext.menu.CheckItem({
		text : _TrackerMain_French,
		group : 'langcheckgroup',
		handler : handlerMenu
	});

var menuSk = new Ext.menu.CheckItem({
		text : _TrackerMain_Sk,
		group : 'langcheckgroup',
		handler : handlerMenu
	});

var menuHu = new Ext.menu.CheckItem({
		text : "Magyar",
		group : 'langcheckgroup',
		handler : handlerMenu
	});

var menuBosi = new Ext.menu.CheckItem({
		text : "فارسی",
		group : 'langcheckgroup',
		handler : handlerMenu
	});

var menuPolski = new Ext.menu.CheckItem({
		text : "Polski",
		group : 'langcheckgroup',
		handler : handlerMenu
	});

var menuPolish = new Ext.menu.CheckItem({
		text : "български",
		group : 'langcheckgroup',
		handler : handlerMenu
	});

var menuLao = new Ext.menu.CheckItem({
		text : "ພາສາລາວ",
		group : 'langcheckgroup',
		handler : handlerMenu
	});

var menuCZ = new Ext.menu.CheckItem({
		text : "český",
		group : 'langcheckgroup',
		handler : handlerMenu
	});

var menuGR = new Ext.menu.CheckItem({
		text : "ελληνικά",
		group : 'langcheckgroup',
		handler : handlerMenu
	});

var menuTr = new Ext.menu.CheckItem({
		text : "Turkçe",
		group : 'langcheckgroup',
		handler : handlerMenu
	});

var menuSQAL = new Ext.menu.CheckItem({
		text : "Shqipëri",
		group : 'langcheckgroup',
		handler : handlerMenu
	});

var menuMN = new Ext.menu.CheckItem({
		text : "Монгол ",
		group : 'langcheckgroup',
		handler : handlerMenu
	});

var menulanguage = new Ext.menu.Item({
		id : 'menulanguage',
		text : _TrackerMain_Language,
		icon : 'Content/images/comment.png',
		menu : {
			items : [menulangenglish, menulangchinese, menuVietnamese]
		}
	});

function loadLang() {
	var lang = getCookie("gpslang");
	if (lang == null) {
		if (clientlang == "zh-cn" || clientlang == "zh-CN")
			menulangchinese.setChecked(true);
		else if (clientlang.indexOf("es") == 0) //spanish area
			menulangspanish.setChecked(true);
		else if (clientlang.indexOf("de") == 0)
			menude.setChecked(true);
		else if (clientlang.indexOf("da") == 0)
			menuDa.setChecked(true);
		else if (clientlang.indexOf("fa") == 0)
			menuBosi.setChecked(true);
		else if (clientlang.indexOf("fr") == 0)
			menuFrench.setChecked(true);
		else if (clientlang.indexOf("hu") == 0)
			menuHu.setChecked(true);
		else if (clientlang.indexOf("vi") == 0)
			menuVietnamese.setChecked(true);
		else if (clientlang.indexOf("lo") == 0)
			menuLao.setChecked(true);
		else if (clientlang.indexOf("ar") == 0)
			menuAb.setChecked(true);
		else if (clientlang.indexOf("pt") == 0)
			menuPor.setChecked(true);
		else if (clientlang.indexOf("bg-bg") == 0)
			menuPolish.setChecked(true);
		else if (clientlang.indexOf("cs") == 0)
			menuCZ.setChecked(true);
		else if (clientlang.indexOf("pl") == 0)
			menuPolski.setChecked(true);
		else if (clientlang.indexOf("sk") == 0)
			menuSk.setChecked(true);
		else if (clientlang.indexOf("ru") == 0)
			menuRu.setChecked(true);
		else if (clientlang.indexOf("el") == 0)
			menuGR.setChecked(true);
		else if (clientlang.indexOf("tr") == 0)
			menuTr.setChecked(true);
		else if (clientlang.indexOf("sq-al") == 0)
			menuSQAL.setChecked(true);
		else if (clientlang.indexOf("mn-mn") == 0)
			menuMN.setChecked(true);
		else
			menulangenglish.setChecked(true);
	} else if (lang == "zh-CN" || lang == "zh-cn")
		menulangchinese.setChecked(true);
	else if (lang.indexOf("es") == 0) //spanish area
		menulangspanish.setChecked(true);
	else if (lang.indexOf("de") == 0)
		menude.setChecked(true);
	else if (lang.indexOf("da") == 0)
		menuDa.setChecked(true);
	else if (lang.indexOf("fa") == 0)
		menuBosi.setChecked(true);
	else if (lang.indexOf("fr") == 0)
		menuFrench.setChecked(true);
	else if (lang.indexOf("hu") == 0)
		menuHu.setChecked(true);
	else if (lang.indexOf("vi") == 0)
		menuVietnamese.setChecked(true);
	else if (lang.indexOf("lo") == 0)
		menuLao.setChecked(true);
	else if (lang.indexOf("ar") == 0)
		menuAb.setChecked(true);
	else if (lang.indexOf("pt") == 0)
		menuPor.setChecked(true);
	else if (lang.indexOf("bg-bg") == 0)
		menuPolish.setChecked(true);
	else if (lang.indexOf("cs") == 0)
		menuCZ.setChecked(true);
	else if (lang.indexOf("pl") == 0)
		menuPolski.setChecked(true);
	else if (lang.indexOf("sk") == 0)
		menuSk.setChecked(true);
	else if (lang.indexOf("ru") == 0)
		menuRu.setChecked(true);
	else if (lang.indexOf("el") == 0)
		menuGR.setChecked(true);
	else if (lang.indexOf("tr") == 0)
		menuTr.setChecked(true);
	else if (lang.indexOf("sq-al") == 0)
		menuSQAL.checked(true);
	else if (lang.indexOf("mn-mn") == 0)
		menuMN.checked(true);
	else
		menulangenglish.setChecked(true);
}

loadLang(); //load language settings
/************************************************************/

/************************************************************
 *风格类型
 *************************************************************/
var menuskinblue = new Ext.menu.CheckItem({
		text : _TrackerMain_Skin_Blue,
		checked : true,
		group : 'skincheckgroup',
		handler : handlerMenu
	});

var menuskinindigo = new Ext.menu.CheckItem({
		text : _TrackerMain_Skin_Indigo,
		group : 'skincheckgroup',
		handler : handlerMenu
	});

var menuskinblack = new Ext.menu.CheckItem({
		text : _TrackerMain_Skin_Black,
		group : 'skincheckgroup',
		handler : handlerMenu
	});

var menuskinolive = new Ext.menu.CheckItem({
		text : _TrackerMain_Skin_Olive,
		group : 'skincheckgroup',
		handler : handlerMenu
	});

var menuskin = new Ext.menu.Item({
		id : 'menuskin',
		text : _TrackerMain_Skin,
		icon : 'Content/images/theme.png',
		menu : {
			items : [menuskinblue, menuskinindigo, menuskinblack, menuskinolive]
		}
	});

function loadSkin() {
	var skin = getCookie("gpsskin");
	if (skin == null || skin == "blue") {
		menuskinblue.setChecked(true);
		Ext.util.CSS.swapStyleSheet("theme", "../../Scripts/component/resources/css/xtheme-blue.css");
	} else if (skin == "indigo") {
		menuskinindigo.setChecked(true);
		Ext.util.CSS.swapStyleSheet("theme", "../../Scripts/component/resources/css/xtheme-indigo.css");
	} else if (skin == "black") {
		menuskinblack.setChecked(true);
		Ext.util.CSS.swapStyleSheet("theme", "../../Scripts/component/resources/css/xtheme-darkgray.css");
	} else if (skin == "olive") {
		menuskinolive.setChecked(true);
		Ext.util.CSS.swapStyleSheet("theme", "../../Scripts/component/resources/css/xtheme-olive.css");
	}
}

loadSkin(); //load skin settings
/*************************************************************/

var menutimezone = new Ext.menu.Item({
		id : 'menutimezone',
		icon : 'Content/images/clock.png',
		text : _TrackerMain_SystemSettings,
		handler : handlerMenu
	});

var menusystem = new Ext.menu.Menu({
		id : 'menusystem',
		icon : 'Content/images/computer.png',
		items : [	menulanguage,
					menuskin,
					//menutimezone,
					'-',
					{
						id : 'menulogout',
						text : _TrackerMain_Logout,
						icon : 'Content/images/logout16.gif',
						handler : handlerMenu
					}
				]
	});

var showSensorAverage = false;
if (typeof(trackerExtendSensorDefined) != 'undefined') {
	if (trackerExtendSensorDefined)
		showSensorAverage = true;
}
var showCReport1 = false;
if (typeof(creport1) != 'undefined') {
	showCReport1 = creport1;
}

var chooser;
var menureports = new Ext.menu.Menu({
		id : 'menureports',
		items : [{
				text : _TrackerMain_AlarmReport,
				icon : 'Content/images/alarm.png',
				handler : handlerMenu
			}, {
				text : _TrackerMain_HistoryReport,
				icon : 'Content/images/history.png',
				handler : handlerMenu
			}, {
				text : _SMSResource_SmsReport,
				hidden : !showSMS,
				icon : 'Content/images/comment_edit.png',
				handler : handlerMenu
			}, {
				text : _TrackerMain_Chart,
				autoHide : true,
				icon : 'Content/images/record.png',
				handler : handlerMenu//speedChart
			}, {
				text : _TrackerMain_SpeedTimeReport,
				autoHide : true,
				icon : 'Content/images/speed.gif',
				handler : speedUnderTimeWindow
			}, {
				text : _TrackerMain_Parking,
				icon : 'Content/images/parking.png',
				handler : handlerMenu//ParkWindow
			}, {
				text : _TrackerMain_DistanceInfo,
				autoHide : true,
				icon : 'Content/images/drive.gif',
				handler : handlerMenu//distanceWindow
			}, {
				text : _ODOReport_Title,
				autoHide : true,
				icon : 'Content/images/collapse-all.gif',
				handler : handlerMenu//odometersWindow
			}, {
				text : _TxtRouteDeviateCompareChart,
				hidden : !showPolygonFence,
				icon : 'Content/images/chart_line.png',
				handler : handlerMenu // RouteCompareChartWindow
			}
			/*, {
				text : _TrackerMain_PhotoReport,
				autoHide : true,
				icon : 'Content/images/photo.png',
				handler : function () {
					if (!chooser) {
						chooser = showChooser({
								url : 'HandlerGetPicturesList',
								width : 1100,
								height : 480
							});
					}
					chooser.show();
				}
			}
			*/
			, {
				text : _Ext_MultiMedia,
				hidden : !showGBCommand,
				icon : 'Content/images/multimedia.png',
				handler : function () {
					//MultiMediaDataWindow();
				}
			}, {
				text : _TrackerMain_StartCarInfo,
				hidden : !showCReport1,
				icon : 'Content/images/drive.gif',
				handler : function () {
					//CustomerReport1Win();
				}
			}
		]
	});

function confirmOTAWindow() {
	//to create username label and input textbox
	var username = new Ext.form.TextField({
			fieldLabel : _Login_lblUserName,
			labelStyle : 'padding-top:6px;padding-left:20px;width:70px;text-align: left',
			width : 120,
			readOnly : true,
			disabled : true,
			listeners : {
				'specialkey' : function (txt, ev) {
					if (ev.getKey() == ev.ENTER) {
						query();
					}
				}
			}
		});

	//to create password label and input textbox
	var pwd = new Ext.form.TextField({
			fieldLabel : _Login_lblPassword,
			labelStyle : 'padding-top:6px;padding-left:20px;width:70px;text-align: left',
			width : 120,
			inputType : 'password',
			listeners : {
				'specialkey' : function (txt, ev) {
					if (ev.getKey() == ev.ENTER) {
						query();
					}
				}
			}

		});

	var butlogin = new Ext.Button({
			id : 'butlogin',
			text : _RouteResources_Confirm,
			style : 'margin-right:16px',
			width : 80,
			handler : function () {
				query();
			}
		});

	//send request for login
	function query() {
		var name = username.getValue();
		var password = pwd.getValue();
		if (name.trim().length <= 0 || password.trim().length <= 0) {
			Ext.Msg.show({
				title : _TrackerMain_Title,
				msg : _Login_UserNamePasswordEmpty,
				buttons : Ext.Msg.OK,
				animEl : 'elId',
				icon : Ext.MessageBox.WARNING
			});
			return;
		}
		Ext.MessageBox.show({
			msg : _TrackerMain_Loading,
			progressText : _TrackerMain_Loading,
			width : 300,
			wait : true,
			waitConfig : {
				interval : 200
			},
			icon : Ext.MessageBox.INFO
		});
		Ext.Ajax.request({
			url : 'HandlerOTACheck',
			method : 'post',
			params : {
				username : name,
				password : password
			},
			success : function (btn) {
				var val = btn.responseText;
				if (val == 0) {
					Ext.Msg.show({
						title : _TrackerMain_Title,
						msg : _Login_UserNamePasswordWrong,
						buttons : Ext.Msg.OK,
						animEl : 'elId',
						icon : Ext.MessageBox.WARNING
					});
				} else {
					Ext.MessageBox.hide();
					confirmotawin.close();
					OTAWindow();
				}

			},
			failure : function () {
				Ext.MessageBox.hide();
			}
		});

	}

	var confirmotawin = new Ext.Window({
			title : _TrackerMain_Confirm_OTA,
			layout : 'form',
			height : 130,
			width : 300,
			bodyStyle : "padding-top:6px",
			items : [username, pwd],
			minimizable : false,
			buttons : [butlogin]

		});
	confirmotawin.show();

	Ext.Ajax.request({
		url : 'HandlerGetUserName',
		method : 'post',
		success : function (r) {
			username.setValue(r.responseText);
		},
		failure : function () {}
	});
}

var menusearch = new Ext.menu.Menu({
		items : [{
				text : _TrackerMain_LocationSearch,
				icon : 'Content/images/searchmap16.gif',
				handler : handlerMenu
			}, {
				text : _TrackerMain_RouteSearch,
				icon : 'Content/images/route16.gif',
				handler : handlerMenu
			}
			/* phu comment
			, {
				text : _TrackerMain_POI,
				icon : 'Content/images/poi.gif',
				handler : handlerMenu
			}
			*/

		]
	});

var menusupport = new Ext.menu.Menu({
		items : [
			// {
				// text : _TrackerMain_Help_Document,
				// icon : 'Content/images/document.png',
				// handler : handlerMenu
			// },
			{
				text : _TrackerMain_Help_About,
				icon : 'Content/images/info.png',
				handler : handlerMenu
			}
		]
	});

var menuadmin = new Ext.menu.Item({
		text : _TrackerMain_Manager,
		icon : 'Content/images/wrench.png',
		handler : handlerMenu
	});
var menudriver = new Ext.menu.Item({
		text : _DriverResource_Menu,
		icon : 'Content/images/user_gray.png',
		handler : handlerMenu,
		hidden : !showVDR
	});

var menuRFID = new Ext.menu.Item({
		text : _RFIDResource_Menu,
		icon : 'Content/images/vcard.png',
		handler : handlerMenu,
		hidden : !showVDR
	});

var showTrackerDefined = false;
var showTrackerExtendSensor = false;
var showOTA = false;
var showLED = false;
var showParamEditor = false;
if (typeof(trackerDefined) != 'undefined') {
	showTrackerDefined = trackerDefined;
}
if (typeof(trackerExtendSensorDefined) != 'undefined') {
	showTrackerExtendSensor = trackerExtendSensorDefined;
}
if (typeof(otaDefined) != 'undefined') {
	showOTA = otaDefined;
}
if (typeof(ledDefined) != 'undefined') {
	showLED = ledDefined;
}
if (typeof(parameditor) != 'undefined') {
	showParamEditor = parameditor;
}

var menuOTA = new Ext.menu.Item({
		text : _TrackerMain_OTA,
		hidden : (!showOTA),
		icon : 'Content/images/updateicon.gif',
		handler : function () {
			if (g_OTAWindowObject == null)
				confirmOTAWindow();
		}
	});

var menuExtSensorDefine = new Ext.menu.Item({
		text : _CustomerConfigResource_ExtSensorDefine,
		hidden : !showTrackerExtendSensor,
		icon : 'Content/images/item-sensor.gif',
		handler : function () {
			trackerExtendSensorWin();
		}
	});

var menuFuelSensorDefine = new Ext.menu.Item({
		text : _TrackerMain_FuelSensorDefine,
		hidden : !showTrackerExtendSensor,
		icon : 'Content/images/fuel2.jpg',
		handler : function () {
			trackerFuelSensorWin();
		}
	});

var menuLEDSettings = new Ext.menu.Item({
		text : _LED_Settings,
		hidden : !showLED,
		icon : 'Content/images/ledadv.gif',
		handler : function () {
			letallsettingswin();
		}
	});

var menuTrackerDefine = new Ext.menu.Item({
		text : _TrackerMain_TrackerConfig,
		hidden : (!showTrackerDefined),
		icon : 'Content/images/config.png',
		handler : function () {
			trackerConfigWin();
		}
	});

var menuPolygonDefine = new Ext.menu.Item({
		text : _TxtPolygonFenceReport,
		icon : 'Content/images/snipshot.png',
		handler : function () {
			PolygonGeofenceWindow();
		}
	});

var menuPolygonRelationDefine = new Ext.menu.Item({
		text : _TxtTrackerPolygonFenceReport,
		icon : 'Content/images/speeding.png',
		handler : function () {
			TrackerPolygonFenceWindow();
		}
	});

var menuParamEditor = new Ext.menu.Item({
		text : _TrackerMain_ParamEditor,
		hidden : !showParamEditor,
		icon : 'Content/images/snipshot.png',
		handler : function () {
			ParamEditorWin();
		}
	});

var menumanager = new Ext.menu.Menu({
		items : [menuadmin, {
				text : _TrackerMain_CustomerConfig,
				icon : 'Content/images/tag_edit.gif',
				handler : function () {
					if (Ext.getCmp('coustomerconfigwin') == null) {
						//customerconfig.js
						showCustomerConfigWindow();
					} else {
						Ext.getCmp('coustomerconfigwin').show();
					}
				}
			}
			//,menuTrackerDefine
			//  ,menuExtSensorDefine
			//,menuFuelSensorDefine
			// , menuLEDSettings
			// , menuParamEditor
		//, menuPolygonDefine
			// ,menuPolygonRelationDefine
			//, { text: _TrackerMain_SennorReport, autoHide: true, icon: 'Content/images/gonggao.gif', handler: getAllCarsSennorReport }
		, menudriver
			//    ,menuRFID
			//   ,menuOTA
		]
	});

var maintoolbar = new Ext.Toolbar({
		items : [{
				text : _TrackerMain_System,
				menu : menusystem,
				icon : 'Content/images/computer.png'
			}, {
				text : _TrackerMain_Manage,
				menu : menumanager,
				icon : 'Content/images/control.png'
			}, {
				text : _TrackerMain_Reports,
				menu : menureports,
				icon : 'Content/images/report.png'
			}, {
				text : _TrackerMain_MenuSearch,
				menu : menusearch,
				icon : 'Content/images/search16.gif'
			}, {
				text : _TrackerMain_Help,
				menu : menusupport,
				icon : 'Content/images/help.png'
			},
			'->',
			'<img src="Content/images/tracker-logo-16.png"/>'

			//            ,{ text: _TrackerMain_Help, icon: 'Content/images/help.png', handler: function() {
			//
			//            }
			//            }
		]
	});
if (meimaptype == 0 && showPolygonFence) {
	maintoolbar.addItem({
		text : _TrackerMain_MapControl,
		menu : menumapcontrol,
		icon : 'Content/images/application_home.png'
	});
}
maintoolbar.addItem(new Ext.Toolbar.Fill());
maintoolbar.addItem(new Ext.Toolbar.Separator());
var pheader = new Ext.BoxComponent({
		el : 'header',
		border : false,
		anchor : 'none -25'
	});

function handlerMenu(item) {
	if (item.text == _TrackerMain_Logout) {
		Ext.MessageBox.buttonText.ok = _TrackerMain_Yes;
		Ext.MessageBox.buttonText.cancel = _TrackerMain_No;
		Ext.Msg.show({
			title : _TrackerMain_Title,
			msg : _Message_SuretoLogout,
			buttons : Ext.Msg.OKCANCEL,
			animEl : 'elId',
			icon : Ext.MessageBox.QUESTION,
			fn : function (btn) {
				if (btn == 'ok') {
					Ext.Ajax.request({
						url : 'Login/logout',
						method : 'post',
						success : function (btn) {
							var val = btn.responseText;
							window.location.reload(false);
						}
					});
				}
			}
		});
	}else if (item.text == _TrackerMain_Manager) {
		// devicetreewindow.js
		// Manage\Admin
		deviceTreeWindow();
	}
	else if (item.text == _TrackerMain_CalaulateReport) {
		//AllLineChartWindow.js
		calculateUnderTimeWindow();
	} else if (item.text == _TrackerMain_FullMapMode) {
		imap.startDrawPolygonGeofence(0);
	} else if (item.text == _Sensor_Average_Report) {
		//sensoraveragereport.js
		SensorAverageReportWin();
	} else if (item.text == _TrackerMain_StreetViewMode) {
		panelmap.showPanoramaPanel();
		imap.openStreetViewMode();
		item.setText(_TrackerMain_MapMode);
	} else if (item.text == _TrackerMain_MapMode) {
		panelmap.hidePanoramaPanel();
		imap.openMapMode();
		item.setText(_TrackerMain_StreetViewMode);
	} else if (item.text == _TrackerMain_AlarmReport) {
		//alarmwindow.js 
		alarmWindow();
	} else if (item.text == _TrackerMain_HistoryReport) {
		//historywindow.js
		historyWindow();
	} else if(item.text == _TrackerMain_Parking) {
		ParkWindow();
	} else if(item.text == _TrackerMain_DistanceInfo){
		distanceWindow();
	} else if(item.text == _ODOReport_Title){
		odometersWindow();
	} else if(item.text == _TrackerMain_Chart){
		speedChart();
	} else if (item.text == _SMSResource_SmsReport) {
		//sms_report_window.js
		smsReportWindow();
	}  else if (item.text == _TrackerMain_LocationSearch) {
		//locationwindow.js 
		showLocationWindow();
	} else if (item.text == _TrackerMain_RouteSearch) {
		if (meimaptype == 2)
			showRouteWindowM();
		else
			showRouteWindow();
	} else if (item.text == _TrackerMain_POI) {
		//poiwindow.js
		POIWindow();
	} else if (item.text == _DriverResource_Menu) {
		//driverwindow.js
		DriverWindow();
	} else if (item.text == _RFIDResource_Menu) {
		//rfidwindow.js
		RFIDWindow();
	} else if (item.text == _TrackerMain_SystemSettings) {
		//timezonewindow.js
		showSettingsWindow();
	} else if (item.text == _TrackerMain_Help_About) {
		//help.js 
		showHelpAbout();
	} else if (item.text == _TrackerMain_Help_Document) {
		//help.js 
		showHelpDocument();
	} else if (item.text == _TrackerMain_Skin_Blue) {
		setCookie("gpsskin", "blue", 365);
		Ext.util.CSS.swapStyleSheet("theme", "../../Scripts/component/resources/css/xtheme-blue.css");
	} else if (item.text == _TrackerMain_Skin_Olive) {
		setCookie("gpsskin", "olive", 365);
		Ext.util.CSS.swapStyleSheet("theme", "../../Scripts/component/resources/css/xtheme-olive.css");
	} else if (item.text == _TrackerMain_Skin_Black) {
		setCookie("gpsskin", "black", 365);
		Ext.util.CSS.swapStyleSheet("theme", "../../Scripts/component/resources/css/xtheme-darkgray.css");
	} else if (item.text == _TrackerMain_Skin_Indigo) {
		setCookie("gpsskin", "indigo", 365);
		Ext.util.CSS.swapStyleSheet("theme", "../../Scripts/component/resources/css/xtheme-indigo.css");
	} else if (item.text == _TrackerMain_Chinese) {
		setCookie("gpslang", "zh-CN", 365);
		window.location.reload();
	} else if (item.text == _TrackerMain_English) {
		setCookie("gpslang", "en-US", 365);
		window.location.reload();
	} else if (item.text == _TrackerMain_Spanish) {
		setCookie("gpslang", "es-ES", 365);
		window.location.reload();
	} else if (item.text == _TrackerMain_Arabic) {
		setCookie("gpslang", "ar", 365);
		window.location.reload();
	} else if (item.text == _TrackerMain_Vietnamese) {
		setCookie("gpslang", "vi", 365);
		window.location.reload();
	} else if (item.text == _TrackerMain_Russian) {
		setCookie("gpslang", "ru-RU", 365);
		window.location.reload();
	} else if (item.text == _TrackerMain_Portuguese) {
		setCookie("gpslang", "pt", 365);
		window.location.reload();
	} else if (item.text == _TrackerMain_Dansk) {
		setCookie("gpslang", "da", 365);
		window.location.reload();
	} else if (item.text == _TrackerMain_French) {
		setCookie("gpslang", "fr", 365);
		window.location.reload();
	} else if (item.text == "Magyar") {
		setCookie("gpslang", "hu", 365);
		window.location.reload();
	} else if (item.text == _TrackerMain_Sk) {
		setCookie("gpslang", "sk", 365);
		window.location.reload();
	} else if (item.text == "فارسی") {
		setCookie("gpslang", "fa", 365);
		window.location.reload();
	} else if (item.text == "Polski") {
		setCookie("gpslang", "pl", 365);
		window.location.reload();
	} else if (item.text == "български") {
		setCookie("gpslang", "bg-BG", 365);
		window.location.reload();
	} else if (item.text == "ພາສາລາວ") {
		setCookie("gpslang", "lo-LA", 365);
		window.location.reload();
	} else if (item.text == "český") {
		setCookie("gpslang", "cs-CZ", 365);
		window.location.reload();
	} else if (item.text == "Deutsch") {
		setCookie("gpslang", "de", 365);
		window.location.reload();
	} else if (item.text == "ελληνικά") {
		setCookie("gpslang", "el", 365);
		window.location.reload();
	} else if (item.text == "Turkçe") {
		setCookie("gpslang", "tr", 365);
		window.location.reload();
	} else if (item.text == "Shqipëri") {
		setCookie("gpslang", "sq-AL", 365);
		window.location.reload();
	} else if (item.text == "Монгол ") {
		setCookie("gpslang", "mn-MN", 365);
		window.location.reload();
	}
}
